#ifndef EMAILDIALOG_H
#define EMAILDIALOG_H

#include <QDialog>
#include <QObject>

namespace Ui {
class EmailDialog;
}

class EmailDialog : public QDialog
{
    Q_OBJECT

public:
    EmailDialog(QWidget *parent = nullptr, QString email = "");
    ~EmailDialog();

    //设置鼠标按下可移动窗口的区域，在子窗口中必须设置该区域
    void setAreaMovable(const QRect rt);

    void setTextHint(QString text);


public:
    // 鼠标事件
    QRect m_areaMovable;//可移动窗口的区域，鼠标只有在该区域按下才能移动窗口
    bool m_bPressed;//鼠标按下标志（不分左右键）
    QPoint m_ptPress;//鼠标按下的初始位置

public:
    void mousePressEvent(QMouseEvent *);
    void mouseMoveEvent(QMouseEvent *);
    void mouseReleaseEvent(QMouseEvent *);

    void send_verification_code(QString email);
    void do_sendResult(int status);
private slots:
    void on_tb_enter_clicked();

    void on_tb_close_clicked();
signals:
    void verCodeData(QString code);

private:
    Ui::EmailDialog *ui;
    QString m_email;
    QString m_randCodeStr;
};

#endif // EMAILDIALOG_H
